package com.riant.myspring.riant;

import com.riant.myspring.riant.service.UserService;
import com.riant.myspring.spring.MyApplicationContext;

import java.lang.reflect.InvocationTargetException;

/**
 * @Classname Test
 * @Description TODO
 * @Date 2021/5/7 23:49
 * @Created by 张斌
 */
public class Test {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        MyApplicationContext myApplicationContext=new MyApplicationContext(AppConfig.class);
        System.out.println(myApplicationContext.getBean("userService"));
        System.out.println(myApplicationContext.getBean("orderService"));

        UserService userService =(UserService)myApplicationContext.getBean("userService");
        userService.test();
    }
}
